#!/usr/bin/python
#Shreds fasta file into 1020bp-sized fragments. The purpose is to use them in calculation of Average Nucleotide Identities(ANI).

import sys
import re
from Bio import SeqIO

seqfile = sys.argv[1]
sf = SeqIO.read(seqfile, "fasta")

start = 0
stop = 1020

while stop <= len(sf)+1020:
    print ">" + str(start) + "_" + str(stop)
    print sf.seq[start:stop]
    start += 1020
    stop += 1020